I know term was having the same problem I was with e17 autogen on debian sid
saying that imlib2 was not properly installed... so as a quick fix try:
delete lines 202-234
They had to do with a AC_RUN then some program, but it doesnt work on sid.
Also anyone having problems with segfaults in debian/sid after compiling
should install this version of binutils instead, the current one doesnt seem
to work for me. http://www.strath.org/binutils_18.104.22.168.31-1_i386.deb
ln_ originally provided me with the above deb, works wonders