Link necessary libraries on OS X.

Closes #11.