fix configure script to handle --prefix= and properly create Makefile.config