The problem is the order of the parameters on the compile line. Try one of the following two variants:
g++ -o simple simple.cpp `pkg-config --cflags --libs ginac`
g++ -o simple -Wl,--no-as-needed `pkg-config --cflags --libs ginac` simple.cpp
The idea is that the order of the object files and libraries is important to the linker. Very simply put, by default it only links a library if it needs it to resolve some previously unresolved symbols.
The first variant above moves the libraries at the end of the build parameters (so after the object file for your code), while the second variant disables this behavior in the linker.