ensure we append -std=libc++ on os x

This is the way c++11 is supported on OS X via http://libcxx.llvm.org/.

This includes Makefile fixes to append the right flags + one workaround for a missing typedef that is only fixed in unreleased libc++.