Some tweaks to build in both OSX and Linux

Some tweaks to build in both OSX (Mountain Lion) and Linux (Debian Jessie). FYI