https://bugs.gentoo.org/602446

--- a/configure.ac
+++ b/configure.ac
@@ -88,6 +88,7 @@
 # doesn't hust to try pdcurses as a last resort.)
 #
 AC_SEARCH_LIBS([initscr], [ncurses curses pdcurses], [curseslibfound=true], [curseslibfound=false])
+AC_SEARCH_LIBS([keypad], [tinfo])
 
 # Check for libcurl (network client library for http et al).
 #
