Process for the recovery of lipids or hydrocarbons