Support for building on Mac OS X

This pull request addresses the issues brought up in Issue #19 and Issue #26, and enables support for building on either Linux or Mac OS X out of the box.