If you'd like to see a demonstration of how to build MS-DOS 4.00 using FreeDOS, here's a video to do that.
This runs Linux commands that fix the source code — the GitHub version stripped CR/LF to just LF, and mangled some CP437 characters. Then the build runs fine.
Thanks to FreeDOS developer E. C. Masloch ('ecm') for providing these fixes!