add autoconf build system, and fix build on clang