Fix NetBSD and non-ncurses build. Simplify CPPFLAGS.