Added changes to allow operation in Mac OS X, including adding support for platform-specific link flags in the source files.

The format is //#Linux_LINKFLAGS=-lrt and in my case //#Darwin_LINKFLAGS=-lblah