Hi iuri,
According to the Postgresql docs, you need GNU readline and the readline-dev package.
You should be able to do:
$ sudo apt-get install libreadline5-dev
I see that there is also a package called lib64readline4-dev
, which may be more appropriate on your hunky machine.