Make Command Not Working - Relocations in Generic Elf

I am new to ubuntu, I am trying to use make to compile code for an assignment, however the make command is not working, and deletes some of the files that are needed for my assignment. The Makefile was provided by my professor, so I am not sure what the issue could be.

This is the message that I get when I run make:

gcc -c  -Wall -I. -fpic -g -fbounds-check   student.c -o student.o 
gcc   -o tester tester.o student.o ref.o
/usr/bin/ld: tester.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: tester.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: tester.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: tester.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: tester.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: tester.o: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
make: *** [Makefile:10: tester] Error 1

Here is the Makefile in case this is the issue, but my professor told us that we are not supposed to make any changes to this file:

CC=gcc
CFLAGS=-c  -Wall -I. -fpic -g -fbounds-check  

OBJS=tester.o  student.o ref.o

%.o:    %.c %.h
    $(CC) $(CFLAGS) $< -o $@ 

tester: $(OBJS)
    $(CC) $(LDFLAGS)  -o $@ $^

clean:
    rm -f student.o tester.o tester
1
Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article