Is it possible to use xlib (or any other libraries) in linux kernel module?
If yes how the makefile will look like?
No, you cannot use any libraries from userspace (such as xlib) in kernel modules.