update build script to include threads