Fixes build on OSX 10.9

This fixes the build for OSX 10.9, using example from: http://stackoverflow.com/a/11237801

WOMM