Reformulate makefile using make functions.