Statistical mechanical analysis of sparse linear regression as a variable selection problem