Change to autoconf and automake based build system.
1) Do the following to generate Makefile
# aclocal
# autoconf
# automake --add-missing
2) Do the following to configure and build
# ./configure
# make
Add generate configure script.