You didn't mention if you were building nvidia from source or using apt. Either way you were doing it, I suggest trying the other way.
nvidia-kernel-source - NVIDIA binary kernel module source
nvidia-kernel-common - NVIDIA binary kernel module common files
nvidia-glx - NVIDIA binary XFree86 4.x driver
nvidia-glx-dev - NVIDIA binary XFree86 4.x driver development files
use the power of the apt. (or nvidia.com if you are currently trying to use apt). Enjoy