readline must be linked before ncurses or termcap

Since if there are symbols missing in readline, these must be known to
the linker before it handled ncurses or termcap (where these symbols
then are resolved).