Before discussing Song of Solomon and Ecclesiastes we should ask our Christian friends as to why they have MORE than twenty-two books in their Old Testament. Protestants (39), Catholics and other Churches ALL have MORE than twenty-two books in their OT canons. WHY??? 
ONLY twenty-two books enjoyed “confidence”
Geza Vermes tells us, according to Josephus, “only twenty-two books enjoyed confidence , implying that only they were held to be authoritative or canonical and no other writing was worthy of trust (see Against Apion I:38).” 
In fact, “the figure twenty-two was commonly accepted by Jews – and not only by Josephus – as representing the number of books in the biblical canon.” 
***See the update appended at the bottom for the Christian explanation courtesy of brother Ken***
Jesus never sanctioned the Christian Old Testament
“…more than one Qumran scholar maintains that no proper canon of the Old Testament existed until some time after the destruction of the Temple in 70 CE” 
So, Christians who claim Jesus sanctioned the Old Testament canon are indeed noticeably far off the mark – that is to say they are WRONG as a “proper canon” of the OT only came about AFTER Jesus’ earthly ministry.
Rabbis Doubted Song of Solomon and Ecclesiastes in the 2nd century CE!!
Some rabbis doubted the authority of these two books for internal reasons – in the case of the Song of Solomon it – the language was deemed unacceptable by the rabbis:
“…in the early second century CE questions were raised in rabbinic circles about the canonicity of the Song of Solomon (too erotic for the liking of some rabbis) and Ecclesiastes (because of the apparent doubts expressed in it regarding God)…” 
It gets one wondering:
"'How can you say, "We are wise, for we have the law of the LORD," when actually the lying pen of the scribes has handled it falsely? (NIV Jeremiah 8:8)
We see further problems the Christian evangelical community have to contemplate upon. Can Christians really claim their Old Testament is “inspired” despite the above information and the inter-church variation with regards to the OT canon – whilst remaining intellectually honest? I do not believe so.
UPDATE: A sincere Christian has offered an explanation with regards to Josephus' 22 book canon:
The 22 books of the Jews that Josephus mentions are the same as the 39 in the Protestant canon of the OT.
Ruth was appended to Judges.
Lamentations was appended to Jeremiah
the 12 minor prophets were considered "one scroll".
1 & 2 Samuel were one book, Samuel.
1 & 2 Kings were one book, Kings.
1 & 2 Chronicles were one book, Chronicles.
And Ezra and Nehemiah were one book.
Later in history, the Christians separated some of the books into parts 1-2 and the one scroll of the Twelve into 12 separate books, etc.
So, the 39 of Protestant bibles are the same as the Jewish Canon, in fact Protestants have stronger evidence than Roman Catholics on the canon of the OT, because of this.
The Jews did not accept the Apocrypha books that were written between Malachi and when John the Baptist came.
The Full quote of Against Apion 1:8 by Josephus, and he shows the books written from the 5 books of the Law of Moses, through the Prophets and to the time of Artaxerxes ( Esther(Xerxes), Ezra-Nehemiah, Malachi, Chronicles, Haggai, and Zechariah. (the period of the Persians - from Cyrus to Darius the Persian to Xerxes to Artaxerxes.)
Romans 3:2 - the Jews were entrusted with the oracles of God.
Malachi (and Chronicles) were the last written OT inspired Scriptures.
Luke quotes from Malachi 4:5-6 in Luke 1:17 to show that revelation stopped in Malachi (the time of Artaxerxes, in Persia, referenced in Against Apion 1:8 ( or in other versions 1:38-41) see
Luke quoting from Malachi shows the gap, that the books written in between (Apocrypha - Maccabees, etc.) were not inspired God-breathed revelation.
The 22 books that Josephus mentions are the same as the TaNakh (Law, Prophets, Writings) as in Luke 24:44.
and Jerome, the translator of the Vulgate around 400 AD
All affirm that same canon of the OT that protestants have today.
See Roger Beckwith, The OT Canon of the NT Church.
Also, William Webster's articles are very good.
Dr Jerald Dirks: Which Bible?
Sexism – a reason to change the Bible?
 OT Protestant Bible is 39 books whilst the Roman Catholics add a number of books to this as well as additions to the book of Daniel and the book of Esther. Greek Orthodox add EVEN MORE than the Roman Catholics; they have a 151st Psalm rather than ending with 150. They have additions to the book of Jeremiah and add 3rd and 4th Maccabees amongst others. The Ethiopian Orthodox Church has a canon of 46 books in their Old Testament. [Refer to the notes from Dr Jerald Dirks’ lecture Which Bible?]
 The Story of the Scrolls, Geza Vermes, Penguin Books, 2010, p 101
 The Story of the Scrolls, Geza Vermes, Penguin Books, 2010, p 100