DigiESP for Linux - how do I use g++ not gcc to link library

I have a library that I need to link with my application.
Application compiles correctly with arm-linux-gcc invoked by the build system.

When linking the library, I get lots of errors, caused by the use of gcc rather than g++. If I write a makefile as a simple test and invoke g++ to link with the library, all is well.

How can I configure the build environment to do this?

Thanks