Easy, you first find a stud behind the mantle. Then drill a pilot hole where there is a flat spot and screw it back to the wall. Install some filler putty, sand and paint.
Just make sure the screw is long enough to get through the sheetrock.
Also, clean off that caulk before screwing it back. The caulk could keep it from sitting flush. Re-caulk with 'Painters caulk' not silicone if required.