The active cc compiler version has to match the version the kernel was compiled with. Seems to be correctly set in your case.
I suspect you’re missing the kernel headers so the driver doesn’t compile. Please (re)install them for the currently running kernel, then run
sudo dkms install nvidia/440.82 --all
note any errors, then check
dkms status
if the driver state changed to ‘installed’.