Sorry, to not answer your questions about building SDL with debug flags, but I want to draw your attention to this and I hope it works for your project:
There was a recent issue that Chvolow24 reported and solved here on a Mac system where the Address Sanitizer was actually the culprit in causing a leak linked to it’s trying to track memory being passed between the audio driver and SDL audio device.
I see you are on Linux, but your output mentions the Address Sanitizer and Audio Drivers. Perhaps the Sanitizer is still a problem here.
What happens if you remove Address Sanitizer from your compiler arguments and use Valgrind instead?
Edit:
To (hopefully) answer your actual question, you can build a debug version using this cmake argument:
cmake ~/SDL -DCMAKE_BUILD_TYPE=Debug