add CFLAGS to lib/Makefile

test
fix bug1 and bug2 by memory allocate
lib/lib_sample.c: fix bug3 by delete free()
lib/lib_sample.c: fix bug4 by extend the size of dst
lib/lib_sample.c: fix fug5 by define str from char to char array