broken: libtest.a
	$(CC) -o test test.c ./libtest.a -flto

works: libtest.a
	rm -f testlib.o
	ar x libtest.a
	$(CC) -o test test.c ./testlib.o -flto

libtest.a: testlib.c
	$(CC) -o testlib.o -c testlib.c -flto
	ar cru libtest.a testlib.o
	ranlib libtest.a

clean:
	@-rm -f *.o *.a test
