Statically link ncurses and readline from own distribution.
Merge pull request #784 from ktf/fix-readline

Fix readline.