By embracing technology instead of competing with it. Free WiFi, better seating / accommodations for groups, lots of places to plug in, improved atmosphere. It's not impossible for libraries to get "mainstream" again, there are plenty of students needing places to study / hang out and others that would prefer not to have to pay for their WiFi at Starbucks. They should've been capitalizing on the coffeeshop craze, and remodeling themselves to grab some of that market.