CC=gcc PC=python3.7dm-config PIE=-fPIE # this was necessary on my machine CFLAGS=$(shell $(PC) --cflags) LDFLAGS=$(shell $(PC) --ldflags) simple: simple.o $(CC) -o $@ $< $(LDFLAGS) simple.o: simple.c $(CC) -c $(CFLAGS) $(PIE) $<