update makefile

add the log.o to the makefile in order to compile properly

implementation of a stack allocated variable in server callback to make
the function reentrant and thread safe (not tested)