When the rug is pulled out of a room without being lifted up, no work needs to be done against the gravitational force with which it is attracted by the Earth. Work has to be done only against the frictional force that acts between the rug and the floor it is lying on.
The frictional force between any two objects is given as F = Fc*N, where Fc is the coefficient of friction and N is the normal force. In the case of the rug being pulled the normal force is the weight of the rug. It should be noticed that the area of contact between the objects that are moving against each other is not present in the formula used to derive the frictional force. Even if the rug is rolled to reduce the surface area in contact between it and the floor, there is no difference in the normal force. This implies that the same amount of work would need to be done to pull the rug out of the room whether it is rolled up or not. The work required could be reduced if the after the rug is rolled into a cylindrical shape it is not dragged out but is instead rolled out of the room. The coefficient of rolling friction is less than the coefficient of sliding friction; this reduces the force against which work has to be done.