Synthesis of alcohols or diesel from waste including a pyrolysis and/or gasification step