Allows simplifying the Makefile. CMake patch is from upstream. Signed-off-by: Rosen Penev <rosenp@gmail.com>