Elementary amalgamation and joint embedding property for intermediate logics