Check pkg-config once and don't use it if it's not avaialble.
Fixed #313: index out of bounds error with a restriction that has an incorrect number of type vars