Made a cleaner Makefile

Despite still not generic it will now run lex and yacc only when needed.
It can also clean the intermediate files and is more robust against
files that could be named like the special targets.