Add project name.
Fix linking errors on Mac OS X.
Set correct flags and dependencies in Apple.