Use MDF it will be easier for you to get good results.
You can use screws if you want but make sure you are using wood screws (not drywall screws). Use rolled screws, not cut screws. The threads on rolled screws are wider than the shank, on cut screws the threads and shank are the same width. Drill pilot holes as close to the width of the shank as possible. And don't overtighten, the wood that is interlocking with the threads can be sheared out of the hole.
And if you are still concerned, use carriage bolts as suggested by others.