Fix build makefile

Change-Id: I26851cdf0a1339dcd3768d6353f3f11b4821ac5d
diff --git a/mbtk/lynq_lib/Makefile b/mbtk/lynq_lib/Makefile
index 6e5be89..22a5e03 100755
--- a/mbtk/lynq_lib/Makefile
+++ b/mbtk/lynq_lib/Makefile
@@ -22,20 +22,23 @@
 #MY_FILES_PATH += $(LOCAL_PATH)/platform/linux
 #endif
 
-MY_FILES_SUFFIX:=%.c %.cpp
-My_All_Files := $(foreach src_path,$(MY_FILES_PATH), $(shell find "$(src_path)" -type f))
-MY_SRC_LIST  := $(filter $(MY_FILES_SUFFIX),$(My_All_Files))
-MY_SRC_LIST  := $(MY_SRC_LIST:$(LOCAL_PATH)/%=%)
-LOCAL_SRC_FILES += $(MY_SRC_LIST)
-$(info LOCAL_SRC_FILES = $(LOCAL_SRC_FILES))
+LOCAL_SRC_FILES = $(wildcard src/*.c) $(wildcard src/*.cpp)
+OBJS = $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, $(LOCAL_SRC_FILES)))
+$(info OBJS = $(OBJS))
 
 dtarget := $(OUT_DIR)/lib/liblynq_lib.so
 
 all: $(dtarget)
 
-$(dtarget):
-	$(CC) $(CFLAGS) $(LOCAL_SRC_FILES) -o $@ $(DEFINE) $(INC_DIR) $(LIB_DIR) $(LIBS)
+$(dtarget): $(OBJS)
+	$(CC) $(CFLAGS) $(LIB_DIR) $(LIBS) $(OBJS) -o $@
+
+%.o:%.c
+	$(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@
+	
+%.o:%.cpp
+	$(CC) $(CFLAGS) $(INC_DIR) $(DEFINE) -c $< -o $@
 
 clean:
-	
+	rm -f $(OBJS) $(dtarget)