alternative way to compile on Mac OS X
same fixes as for bitcoin to avoid some errors on Mac OS compiling