Add error checker in stack.c

Add error checker in stack.c: check if the stack is empty when doing pop().
Add getLastNode operation in list.c
add .o exception to .gitignore