build: Fix check program build

From commit f34959ef25a7c70c545a8e31087a35e8c586e100.
all: Use terminfo instead of termcap

https://bugzilla.gnome.org/show_bug.cgi?id=169295