Fixes for building on OS X: Add macros missing in Apple's headers,
and add an "osx" build target with proper linker flags.