Fix cppcheck rule in Makefile; static inline timediff function to resolve linking error