In order to use sfdk build, you have to have the target architecture set with sfdk config --global --push target SailfishOS-4.5.0.18-aarch64 and the accompanying rpm/app-name.spec file which then does all the leg work.
You can drop into the build target shell with sfdk build-shell and manually gcc your way or whatever it is you need to do. Installing packages into the target should be done via the spec file, but you can use sfdk build-shell --maintain and use zypper to install packages.
One nugget: I was stuck with pkgconfig(liblzma) for example and couldn’t figure out how to find out the package name to install manually. Turns out that can be found out with zypper search --provides liblzma.