Linker used libSDL2.a, which is static library. Static library lacks dependenciy information so all additional dependencies have to be specified manually. To use dynamic library, you need libSDL2.dll.a in your libs paths (newer gcc/mingw should accept SDL2.dll as well, even without .dll.a, although I never used that). Also of course with dynamic linking you'll need SDL2.dll either bundled with your resulting .exe or in system directory to actually launch resulting program.

You could put both of these libraries into the same directory, like it is in SDL2 distribution. By default, linker should prefer dynamic library if it can find one, or it could be controlled manually with -Wl,-Bstatic and -Wl,-Bdynamic switches (if you want that, read documentation first - these flags affect all libraries specified after it).

(it only covers mingw; msvc have different library format, and SDL2 have separate download file for it)