Had this on Ubuntu 8.04.4 with kernel 2.6.24-30 on ESXi 4.1u2
search around and try to modify the version.h / utsrelease.h according to Krusty810 from here:
Searching for GCC...
Detected GCC binary at "/usr/bin/gcc".
The path "/usr/bin/gcc" appears to be a valid path to the gcc binary.
Would you like to change it? [no]
Searching for a valid kernel header path...
The path "" is not a valid path to the 2.6.24-30-server kernel headers.
Would you like to change it? [yes]
But this didn't work for me.
At the end uninstall vmware tools and install it via OSP worked for me.