Makefile: refactor regex compat support