Adding needed #endifs to gen_intrinsics.c and making check for genlib ,more specific so it does not alter mapgenlib