Directly speaking, that's right. Indirectly, the latter statement is, of course, false in that libraries provide the means for anyone in society to raise their station and thus contribute more to GDP.
But I think you're making a good point that others are missing: The most valuable things in society are often things that aren't easily measured by straightforward means.