Fix makefiles

These tweaks were all needed to compile on my 64-bit system.