Convert build system to autotools

Use autotools for building to better support cross-compiling
instead of using a hard coded Makefile.