Fixed compiling/linking on OS X