Build toolchain for unit tests

Modified build toolchain and Makefile in order to build unit tests on OS X.