It seems that your Makefile don't know where to search for kernel headers. Can you try with this Makefile : just type make
and it should build using kernel-headers of your current running kernel.
# Run this Makefile as follows:
# (MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
#
KDIR= /lib/modules/$(shell uname -r)/build
obj-m := test.o
all:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
install:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules_install
depmod -a
clean:
rm -f *~
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean