echo "lang: lang.l" > Makefile
This Makefile is incorrect, as it tells make that 'lang.l' is a *direct* dependency of lang. That's not true: lang.l has to be run through lex to get a .c file that can compiled to get lang.
It tries to link the .l file.
make doesn't need any special instructions to tell it how to generate an executable from a .l file, but it'll do the Wrong Thing if you tell it the wrong thing. To achieve your apparent goal you can simply run it with *no* Makefile and give it the name of the matching executable (ala "make lang" in this case) or use a Makefile sets the default target ala
echo ".DEFAULT_GOAL = lang" >Makefile
and it'll deduce the rest from its default pattern rules.
Philip Guenther