fix bugs in list.c and update Makefile for test.