build script fixes for ubuntu 12.04