Fix for tmpfile on windows and corrected Makefile