improve libdis detection, fix sed for -I removal and defines