Allows simplifying the Makefile. Also faster compilation. Added CMake patch to fix compilation. Signed-off-by: Rosen Penev <rosenp@gmail.com>