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

`-stdlib=libc++` is needed on OS X to link to `libc++` instead of `libstdc++`, the former with supports c++11 and the later which does not (since apple is not updating it). More info at: 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++.