Building for APM2.x - for a sailboat

Hello!
I can build (make apm2) APMrover2-2.44 but not APMrover2-2.50 with Make on Windows.

I looked through the the .mk files but have no idea who is trying to execute the program ‘g’ to produce all these g: Command not found errors. Transcript follows.

I had understood from documentation that APMrover2 (and Plane) can be build for apm2 boards up to the current release version, only Copter cannot.
Can someone correct my misunderstanding, and hopefully point out the last version of APMrover2 I can use?

I am trying to modify APMrover2 to make an autonomous sailboat that I’ll call APMsailboat, and would like to use an APM2.6 (because I can’t get a hold of PixHawk hardware - everyone is sold out, and I have severe time constraints. I know APM2.x is going the way of the dodo, but it’s not like I need the computing power…)

Thanks!
William

(in APMrover2-2.50):
User@DESKTOP-VUP9V0B /c/Users/User/Documents/GitHub/ardupilot/APMrover2
$ make apm2
Reading /c/Users/User/Documents/GitHub/ardupilot/config.mk
%% APMrover2.o
/bin/sh: g: command not found
make: [/tmp/APMrover2.build/APMrover2.o] Error 127 (ignored)
// BUILDROOT=/tmp/APMrover2.build HAL_BOARD=HAL_BOARD_APM2 HAL_BOARD_SUBTYPE=HAL_BOARD_SUBTYPE_AVR_APM2 TOOLCHAIN=AVR EXTRAFLAGS=-DGIT_VERSION=“705d3d56”
%% GCS_Mavlink.o
/bin/sh: g: command not found
make: [/tmp/APMrover2.build/GCS_Mavlink.o] Error 127 (ignored)
%% Log.o

[[snip]]

%% libraries/AP_HAL_AVR/utility/pins_arduino_mega.o
/bin/sh: g: command not found
make: [/tmp/APMrover2.build/libraries/AP_HAL_AVR/utility/pins_arduino_mega.o] Error 127 (ignored)
%% libraries/AP_HAL_FLYMAPLE/utility/EEPROM.o
/bin/sh: g: command not found
make: [/tmp/APMrover2.build/libraries/AP_HAL_FLYMAPLE/utility/EEPROM.o] Error 127 (ignored)
%% libraries/AP_HAL_FLYMAPLE/utility/flash_stm32.o
/bin/sh: g: command not found
make: [/tmp/APMrover2.build/libraries/AP_HAL_FLYMAPLE/utility/flash_stm32.o] Error 127 (ignored)
%% APMrover2.elf
make: g: Command not found
make: [/tmp/APMrover2.build/APMrover2.elf] Error 127 (ignored)
cp: cannot stat `/tmp/APMrover2.build/APMrover2.elf’: No such file or directory
make: *** [/tmp/APMrover2.build/APMrover2.elf] Error 1