Link with libtinfo if available

Bug: https://bugs.gentoo.org/529782
Signed-off-by: Matt Turner <mattst88@gmail.com>
6 jobs for tinfo in 1 minute and 41 seconds (queued for 2 seconds)