Try Sierra or High Sierra and see if one of those works. Your hardware is much too new for Mavericks to work, Yosemite as well. Older versions of macOS have no support for newer hardware because it didn't exist yet when those versions were released. Apple doesn't add support later on, they move on to a new macOS version every year.
See:
https://www.tonymacx86.com/threads/...versions-of-os-x-using-older-chipsets.141225/
Here's a guide from someone that installed Mojave recently on their 7040 Dell Optiplex.
2019/6/19 Mojave 10.14.5 Installation Instructions #41 2019/4/6 Re-edited At First Succeeded in building Hackintosh with Dell's Optiplex 3040 sff and GT710 graphics card. I hope it will be helpful for many people. Optiplex 3040 sff This time specification CPU: intel core i5-6500 (core...
www.tonymacx86.com