We already have background checks.  Ostrem had nothing in his background that prevented him from obtaining a firearm.  So background checks were worthless in this case.  

Sounds like what you want is a crystal ball.  Maybe gun stores should hire psychics who can look into a crystal ball and deny sales to anyone who will do something criminal in the future.

And just FYI, the USA had just over 17,000 murders in 2016.  Don't know how you came up with 40,000.