O erro está ocorrendo porque você espera que seu shell entenda e execute o arquivo.
Os Makefiles não devem ser executáveis - eles são fornecidos como entradas para o comando make
, por exemplo, make -f Makefile
- ou apenas make
, pois ele procurará no diretório atual por um arquivo com nomes padrão como Makefile
, makefile
.
De man make
:
To prepare to use make, you must write a file called the makefile that
describes the relationships among files in your program, and the states
the commands for updating each file. In a program, typically the exe‐
cutable file is updated from object files, which are in turn made by
compiling source files.
Once a suitable makefile exists, each time you change some source
files, this simple shell command:
make
suffices to perform all necessary recompilations. The make program
uses the makefile description and the last-modification times of the
files to decide which of the files need to be updated. For each of
those files, it issues the commands recorded in the makefile.
make executes commands in the makefile to update one or more target
names, where name is typically a program. If no -f option is present,
make will look for the makefiles GNUmakefile, makefile, and Makefile,
in that order.