Fixed some configuration on mac
A bunch of changes to compile on clang