BF: catch issue where nan in adjmatrix can lead to bad lookup table, and...

NANs were causing the sort function in make_cost_thresh_lookup to return meaningless lookup tables for thresholding the matrix...(and not raising an error)

added a catch to raise a ValueError warning user, and added a test to check for this