It would be interesting to know whether a .deb package which causes a
good long-running "dpkg -i" does so reproducibly several times.
That way you would learn that it is a problem at "make dep-pkg" time
(if working once means working always) or a problem at "dpkg -i"-time
(if working once is followed by failure next time).
(Don't forget to record the output of you "make dep-pkg" runs in a file
and to store one which causes immediate "dpkg -i"-failure and one which
causes "dpkg -i" success at least once. Differences between those might
give a clue why the nvidia code fails in conftest/functions.h.)