Revert "Remove obsolete termcap support"

Termcap is still used by BSDs.

This reverts commit a44db36b99fa661bcb7368385f87dd36389375fa.

Conflicts:
	main.c
	term.c
	term.h
Makefile.lib clears BASIC_CFLAGS etc.
Try to fix build on FreeBSD 10.0