Updated makefiles to use Autoconf

