Backported Makefile from upstream