When you build for your native target (by omitting -target/-Dtarget or explicitly specifying native), Zig automatically adds host system paths like /usr/include or usr/lib to the include and library search paths.
When you build for a specific target like x86_64-linux-musl, Zig takes that to mean that you want to perform a “hermetic” (system-independent) build that doesn’t let system headers, libraries and other files from the host system leak into the build.
You could try explicitly adding a search path exe.root_module.addLibraryPath(.{ .cwd_relative = "/usr/lib" }) and/or specifying the use_pkg_config option in your call to linkSystemLibrary2.
However, I will note that if your goal is a system-independent “runs anywhere” build, statically linking with a system library might be problematic if GraphicsMagick was built with your particular host system in mind. So if you find that your program works on your system but not others’, you might want to instead compile GraphicsMagick yourself.