You need to run aclocal before autogen.sh or ./configure. If you dont have it, install automake or autotool.
Thanks, I installed automake and got a bit further but now I get the error
configure.ac:125: error: possibly undefined macro: AC_MSG_ERROR
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
Do you have the needed build dependancies installed? You might get this error if autotools cannot find a definition for LIBCURL_CHECK_CONFIG (the only macro in configure.ac that actually calls AC_MSG_ERROR)
Try:
sudo apt-get install libcurl4-openssl-dev