solving linking errors on Mac OS X