The photographer Peter Hujar and the artist Paul Thek were at the heart of New York’s 1960s art scene but preferred the fringes