The linux kernel headers/source are installed in /usr/src/.
For example the source of 2.4.18-3 can be called: linux-2.4.18-3 and of 2.4.18-5: linux-2.4.18-5.
Next to this there's a symlink I think linux or linux-2.4 to linux-2.4.18-3.
The nvidia makefiles try to use the source /usr/src/linux but when it is pointing to 2.4.18-3 you won't get a correct kernel module for your version.
You need to remove the symlink linux and create a new one using:
ln -s linux-2.4.18-5 linux
It will be something like this for your distro.