It was linking -lcurses -ltermcap but on FreeBSD these are the aliases for the same library, -lncurses, so just specific that directly.