Building on linux

Here are some commits I needed to get building on linux to work.

I still wasn't able to compile the 32bit libraries, but I assume it's something different with my environment (64 bit).

Let me know if I can clean these commits up any.