Fix makefile_base_posix for OS X
Fixed various compiler warnings
Fixed more compiler warnings