The degenerate two well problem for piecewise affine maps