-test_mem_speed: $(PRJDIR)/lib*.a test_mem_speed.o
- $(CC) -o $@ test_mem_speed.o -L$(PRJDIR) -lsim -lutil -lcmd -lsim
+test_mem_speed: $(top_builddir)/lib*.a test_mem_speed.o
+ $(CXX) -o $@ test_mem_speed.o -L$(top_builddir) -Wl,--start-group -lsim -lutil -lcmd -Wl,--end-group