There's a list or requirements here...
https://gambaswiki.org/wiki/install#t1
gb.qt5 Qt5Core >= 5.3.0 Qt5Gui Qt5Widgets Qt5Svg Qt5PrintSupport
gb.qt5.ext Qt5Core >= 5.3.0 Qt5Gui Qt5Widgets x11
gb.qt5.opengl Qt5Core >= 5.3.0 Qt5Gui Qt5Widgets Qt5OpenGL gl x11
Note: Qt5OpenGL is not needed if your Qt version is >= 5.4.0
gb.qt5.wayland Qt5Core >= 5.3.0 Qt5Gui Qt5Widgets
gb.qt5.webkit Qt5Core >= 5.3.0 Qt5Gui Qt5Widgets Qt5Network Qt5Xml Qt5WebKit Qt5WebKitWidgets Qt5PrintSupport
gb.qt5.webview Qt5Core >= 5.5.0 Qt5WebEngineWidgets
gb.qt5.x11 Qt5Core >= 5.3.0 Qt5Gui Qt5Widgets Qt5X11Extras x11-xcb
not sure what else to suggest.
(except do a proper desktop install like apt install mate-desktop-environment , it's likely normal desktop installs are installing a lot more than you are)
installing gambas via autotools might help.
the dependency install might install missing qt5 packages and the ./configure command should report and problems with missing things.
sudo apt-get update && sudo apt-get install -y build-essential g++ automake autoconf libbz2-dev libzstd-dev default-libmysqlclient-dev unixodbc-dev libpq-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev libpoppler-private-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-3.0-dev libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qtwebengine5-dev libwebkit2gtk-4.0-dev git libssl-dev
./reconf-all
./configure -C -q --disable-keyring --disable-sqlite2 --disable-qt4
make -j$(nproc)
# if all has gone well you must remove apt gambas now.
sudo apt remove gambas3*
# now install compiled version..
sudo make install