OSX compatibility for ct-ng

Incorporated various patches (from homebrew and ppl bugtracker) and a couple of my own tweak to get ct-ng to build on my OSX 10.10 machine.
I tried to keep those patches OSX-specific, but someone might need to have a look at zconf.gperf