If you're trying to build CM from official source, CM's wiki has quite the resource for that, teaches you step by step from setting up your Linux environment to making the final bacon. I haven't built other ROMs yet, but steps should be similar.
Sent from Google Nexus 4 @ CM11