Based on the error messages you were getting, it appears that you were trying to build something to go into /opt/kde, whereas the kde supporting libraries are located in /usr for VL 5.9. Here's a quick tip in building KDE apps when you are not sure of what the prefix is. Instead of passing an absolute prefix to the configure script, pass the following instead:
Note the backticks surrounding the kde-config --prefix command. The backticks tell the shell that it's supposed to take the results of executing "kde-config --prefix" and use that for the prefix variable.