Fix CMake build on OS X

* Expat and Freetype did not compile
* There were linker errors regarding curl and crypto
* Linking did not work when generating an Xcode project