When linking against libraries using the -l option (say -lfoo), gcc will prefer a shared object to a static library if both are found (will prefer
-l
-lfoo
Just add the .a file to the link line without -l as if it were a .o file.
.a
.o