Allow building without ncurses

Simple patch to allow building without ncurses. This should help people building for android and other non-standard systems.