Instead of installing SDL2 manually, install from MSYS2:
pacman -S mingw-w64-ucrt-x86_64-SDL2
.
pacman -S mingw-w64-ucrt-x86_64-SDL2
.