[1.5.x] Allowed overriding variables in docs/Makefile.

Backport of c694e6220e from master