The final Link command ends up being > 24KB in length. This causes compile to fail with MSYS2 (and Windows in general?) because of some arbitrary command length limitations. The solution is to use a response file to store $(OBJS_REL). However, I am not sure where the change would be best done. To fix it locally, here is the change I did:
$(ELF): $(LD_SCRIPT) $(LD_SCRIPT_DEPS) $(OBJS) libagbsyscall
$(file >${OBJ_DIR}/objects.rsp,$(OBJS_REL))
@cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< --print-memory-usage -o ../../$@ @objects.rsp $(LIB) | cat
@echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< --print-memory-usage -o ../../$@ <objs> <libs> | cat"
$(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent
I'm not a makefile expert someone with more experience should probably do this change in the appropriate way.