ncurses can be build as separate libraries, thus it is possible to have a
separated libtinfo which has the symbol for tgetent.
This patch is changing the order of library checks to find tgetent, thus
that tinfo libs get checked before ncurses, so birdc will be linked against
libtinfo and not libncurses which leads to linking problems.