An optimization approach for flow simulations in poro-fractured media with complex geometries