Fixed up configure scripts and Makefiles to work with new setup.