Fix build on OS X 10.9 (Mavericks)

* version 0.5.1.0
* Make sure to #include stubs.h first everywhere
* CPP definitions to ensure that language-c can parse the Mavericks headers
* Properly link against the CUDA.framework on darwin