Static compiling fix

I have an alias buildstatic='make SHARED=0 CC="gcc -static"' to ease building small programs statically so I can run them on my shared hosting server (i.e. Dreamhost), so I had to tweak the configure script to explicitly require terminfo after ncurses otherwise the dependency check would fail when building it statically. I've just tested both builds here and they worked fine, I'm only not sure if the place of this fix is appropriate but oh well...