Use stdint.h
Quick hack for OSX.
Fix return code to Unix style.
Add how to compile on OSX10.6.8
change BUILD.md description to os generic