Actually, current configure.ac even contains ncurses5 style detection. But automake system was rewritten in time between, and check was ported to the new one. However the new version looks like a straightforward port of the old one, something is going wrong and attempt to link with -lncursesw is not checked. I am just debugging the configure script.