It looks as if you don't have the kernel header files installed, which I would expect if you installed 5.0 from a CD ; only the 5.0 DVD has these files. Unfortunately, they are not in a package in the 5.0 DVD, so if you get the DVD you would have to identify the files and copy them across to the HDD.
I no longer have 5.0 on my system so I can't remember all the details; you can identify what is needed from your script messages like :-
Compiling DRM module...Makefile:266: /usr/src/linux-2.6.17/scripts/Kbuild.include: No such file or directory
Makefile:486: /usr/src/linux-2.6.17/arch/i386/Makefile: No such file or directory