Better logic used when looking for libraries (GSL, TOODI)

The code now honours the results of 'gsl-config' and uses appropriate variable names when linking to TOODI.