Move to a top-level Makefile (not one in src/ and one in doc/) and support out-of-tree builds by writing a minimal configure script that copies the Makefile to $CWD and sets its VPATH.
(Not to be confused with "use autoconf". The configure script can be plain shell or python).