Fixes to support building on OS X

I was building on my macbook and ran into a few issues in addition to needing to install a few packages from Homebrew. So I made a pull request with my changes in case you guys want to incorperate them. I have not tested these changes on Linux.

Also I had to install these things from Homebrew before building:

- `coreutils`
- `findutils`
- `gnu-tar`