Why would you want to compile a program? Knoppix is based on Debian. Do you not know about Debian's packaging system?
Code:
$su
# apt-get -s install xscreensaver
# apt-get install xscreensaver
# exit
$
The -s option will simulate the installation, so you will see whether it should work. If the simulation looks good, then run the install.

I've never actually tried this in Knoppix, but it should work.