Changed build to dynamically link, removed unused libraries. Now compiles on OSX and Linux.