Just now, I have compiled and uploaded into Arduino MEGA successfully. It is working fine.
Why do you encounter problem?
Probably, the Library has not been included correctly in the IDE? To include the dht11-master.zip Library, I have followed these steps:
1. Save the zip file in the desktop.
2. From the Tool bar of IDE: Sketch ----> Include Library ----> Add .ZIP Library... -----> Desktop ----> Select the dht11-master.zip file ----->click on Open
Hope, your problem will be solved.