Mac OS X build support

I made some adjustments that were required to build the project on Mac.
You are welcome to review and add to the main project.