Both readline and libedit link with ncurses but the configure script forgets
to take that into account, causing the detection to fail when linking
statically.
Fix it by using pkg-config to add the needed linker options for ncurses.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>