In order to successfully compile KWin4, you need KDE 2.0
All required libraries as well as KWin4 itself can be found on ftp://ftp.kde.org/pub/kde/.