Fix most problems for Mac OSX. Only thing left is Samplers.

As per title.

Check that the Makefile works for you! I've modified it so that it properly parses pkg-config arguments for Mac.