Fixed mac os compilation on 10.8

This fixes compilation on osx 10.8 by linking against libc++ (default in 10.9 but needs to be set explicitly in 10.8)