Build script update and bugfix

Adjust the build script for changes to Pkg2, require the latest BinDeps version and fix a bug in `errno`