Link necessary libraries on OS X.