doc: Fix version reading in Makefile on Windows (#58536)
I copied this expression from the toplevel Makefile, but here we need to
read the version eargerly, because otherwise cygpath_w does not work.
This had broken the windows build, but I did not notice due to the
ongoing CI difficulties.