Fixes to build 0.9.1 on Mac OS X 10.9

Source for most of the patches is here: https://gist.github.com/duedal/7156317

There's still an extra 10.9 requirement to configure with CXXFLAGS="-std=c++11", but at least it'll build.