Fix build on Mac

Distutils is so primitive! I had to reimplement the whole
build_extension() method (stripped down a bit), just to pass different
compiler options for C and C++ files.

And while at it, made it define OS_MACOSX when building on Mac (which is
not easy to set from setup.py as well).

Fixes #1