Handle the lack of 8-byte atomics in some platforms (from Fedora).
Don't optimize for the specific build machine's architecture (binary portability).
Don't assume implicit include of <unistd.h>.
Fix mismatched types causing warnings.
Use Lua 5.1 explicitly, because 5.2 isn't supported.
Patches from homebrew allowing building on OSX.