Fixed tests in build.sh for Linux compatibility

Fixes #40
Tested on both Ubuntu 12.04 and OS X 10.7