Fix for cross-compiling on OS-X with C++11

This is the first half of fixes for C++11 OSX cross-compiling. The -stdlib=libc++ is needed to work around OS-X's reliance on the gcc 4.2 codeline.